10 research outputs found

    Trust, but Verify: Two-Phase Typing for Dynamic Languages

    Get PDF
    A key challenge when statically typing so-called dynamic languages is the ubiquity of value-based overloading, where a given function can dynamically reflect upon and behave according to the types of its arguments. Thus, to establish basic types, the analysis must reason precisely about values, but in the presence of higher-order functions and polymorphism, this reasoning itself can require basic types. In this paper we address this chicken-and-egg problem by introducing the framework of two-phased typing. The first "trust" phase performs classical, i.e. flow-, path- and value-insensitive type checking to assign basic types to various program expressions. When the check inevitably runs into "errors" due to value-insensitivity, it wraps problematic expressions with DEAD-casts, which explicate the trust obligations that must be discharged by the second phase. The second phase uses refinement typing, a flow- and path-sensitive analysis, that decorates the first phase's types with logical predicates to track value relationships and thereby verify the casts and establish other correctness properties for dynamically typed languages

    Implementation of a type and effect system for deadlock avoidance in C/Pthreads

    No full text
    86 σ.Τα συστήματα παράλληλης επεξεργασίας έχουν γνωρίσει ραγδαία ανάπτυξη τις τελευταίες δεκαετίες, η οποία έχει επιδράσει πολλαπλασιαστικά στην υπολογιστική τους ισχύ, αλλά παράλληλα έχει εισαγάγει αρκετές προκλήσεις στον προγραμματισμό τους, μία από τις οποίες είναι η απουσία των αδιεξόδων που οφείλονται στη χρήση κλειδωμάτων. Σε αυτή τη διπλωματική αρχικά εκθέτουμε στατιστικά στοιχεία σχετικά με τη χρήση των προτύπων κλειδώματος σε μια βάση πραγματικών προγραμμάτων που συγκεντρώσαμε. Εν συνεχεία παρουσιάζουμε την υλοποίηση ενός συστήματος τύπων για την αποφυγή αδιεξόδων, όπου η έρευνα μέχρι στιγμής έχει αποδώσει περιορισμένα αποτελέσματα σε σχέση με την πρόληψη αδιεξόδων. Η υλοποίησή μας έχει ως στόχο προγράμματα σε C που χρησιμοποιούν το πρότυπο των Pthreads. Οι καινοτομίες του εργαλείου που αναπτύξαμε είναι ότι μπορεί να αντιμετωπίσει περιπτώσεις μη δομημένου κλειδώματος μεταβλητών, δεν επιβάλει αυστηρή σειρά στο κλείδωμα μεταβλητών, όπως οι περισσότερες προσεγγίσεις στην πρόληψη αδιεξόδων, και δεν απαιτεί από το χρήστη να επισημειώσει με οποιονδήποτε τρόπο το αρχικό πρόγραμμα. Το εργαλείο αποτελείται τόσο από ένα τμήμα στατικής ανάλυσης των προγραμμάτων εισόδου, το οποίο συγκεντρώνει πληροφορίες σχετικά με το κλείδωμα μεταβλητών, όσο και από μια βιβλιοθήκη χρόνου εκτέλεσης που χρησιμοποιώντας την στατικά συγκεντρωμένη πληροφορία αποφαίνεται κατά πόσο είναι ασφαλές να γίνει ένα κλείδωμα, ώστε το σύστημα να μην περιέλθει σε αδιέξοδο. Τέλος, παρουσιάζουμε μια σειρά από παραδείγματα εκτέλεσης όπου καταδεικνύεται η ορθότητα λειτουργίας του εργαλείου και αξιολογούνται οι επιδόσεις του σε σχέση με την αρχική έκδοση των προγραμμάτων.The last few decades have seen great rise in the development of parallel systems, which has multiplied their computational power, but at the same time has introduced several challenges in their programming, deadlock freedom being one of the most important. In this thesis, we begin with presenting statistics concerning the usage of lock primitives that were gathered from a code base of real world programs. We then introduce the implementation of a type and effect system for deadlock avoidance, which is a field where research results so far have been limited compared to deadlock prevention. Our approach targets C programs that use the Pthreads specifications. The novelties of our tool include its ability to handle non block-structured locking, the fact that it does not impose a strict lock acquisition order, like most deadlock prevention approaches, and that it does not require the user to provide any annotation on the original source code. The tool comprises both a static analysis part, which collects information regarding locking, and a runtime library which uses this gathered information and decides whether it is safe to grant a lock, in order to avoid deadlocks. We finally present a series of benchmarks that manifest the correctness of our tool and demonstrate its performance in terms of the original program.Παναγιώτης Π. Βεκρή

    Towards Verifying Android Apps for the Absence of No-Sleep Energy Bugs

    No full text
    The Android OS conserves battery life by aggressively turning off components, such as screen and GPS, while allowing application developers to explicitly prevent part of this behavior using the WakeLock API. Unfortunately, the inherent complexity of the Android programming model and developer errors often lead to improper use of Wake-Locks that manifests as no-sleep bugs. To mitigate this problem, we have implemented a tool that verifies the absence of this kind of energy bugs w.r.t. a set of Wake-Lock specific policies using a precise, inter-procedural data flow analysis framework to enforce them. We run our analysis on 328 Android apps that utilize WakeLocks, verify 145 of them and shed light on the locking patterns employed and when these can be harmful. Further, we identify challenges that remain in order to make verification of Android apps even more precise.

    Second Shoulder and Elbow Reanimation Procedures in Late Obstetrical Paralysis Patients

    No full text
    Obstetrical brachial plexus palsy invariably involves the upper roots. The natural history of the injury shows that if the condition is left untreated, spontaneous reinnervation that occurs in a variable degree in these patients leaves characteristic deformities of the shoulder and elbow. Common sequelae are the internal rotation and adduction deformity of the shoulder, and elbow flexion contractures. Early microsurgical reconstruction of the affected plexus leads to more rewarding overall function of the shoulder and elbow, but residual deformities might appear again, similar to the ones noticed in untreated cases, that are even less serious. Thus, secondary procedures are mandatory to reanimating the shoulder and elbow, and especially to provide adequate abduction and external rotation of the shoulder and a more neutral appearance of the elbow regarding flexion–extension equilibrium
    corecore